<?
// +----------------------------------------------------------------------
// | 分销联盟-联盟列表，管理员账号
// +----------------------------------------------------------------------
// | Author: TongBC <50249101@qq.com>
// +----------------------------------------------------------------------
// | Date  : 2015/03/06
// +----------------------------------------------------------------------
include_once("/var/www/html/new/d/common/header.html");
include_once("/var/www/html/new/d/common/left.html");
include_once("/var/www/html/new/d/class/MemberAccount.class.php");
include_once("/var/www/html/new/d/class/Alliance.class.php");
include_once("/var/www/html/new/d/common/page.php");

if($_SESSION['sid']!=1) exit('非法身份');
$currentPage = ($_REQUEST['currentPage']) ? $_REQUEST['currentPage'] : 1;
$pageSize = ($_REQUEST['pageSize']) ? $_REQUEST['pageSize'] : 15;
$now = ($currentPage - 1)*$pageSize;

// 获取联盟列表
$alist = array();
$sql = "select m.dname,d.fid,d.id,d.dtitle,d.dratio,d.dstatus,d.createtime from pft_distributor_union_SE d left join pft_member m on d.fid=m.id limit $now,$pageSize";
$GLOBALS['le']->query($sql);
while($row=$GLOBALS['le']->fetch_assoc()){
	$row['dratio'] = str_replace('|',':',$row['dratio']);
	$alist[] = $row;
}

// 获取总数
$sql = "select count(id) as c from pft_distributor_union_SE";
$GLOBALS['le']->query($sql);
$GLOBALS['le']->fetch_assoc();
$count = $GLOBALS['le']->f('c');
?>
<link rel="stylesheet" href="http://www.12301.cc/css/common/www.12301.cc.global.css"/>
<link rel="stylesheet" href="http://www.12301.cc/css/marketing_list.css"/>
<link rel="stylesheet" href="css/page.css" media="all" />
<!--<script type="text/javascript" src="http://www.12301.cc/js/plugin/json2.js"></script>-->
<!--[if lt IE 7]><div id="childListWrap" class="lt-ie10 lt-ie9 lt-ie8 lt-ie7 ie6 childListWrap"> <![endif]-->
<!--[if IE 7]><div id="childListWrap" class="lt-ie10 lt-ie9 lt-ie8 ie7 childListWrap"> <![endif]-->
<!--[if IE 8]><div id="childListWrap" class="lt-ie10 lt-ie9 ie8 childListWrap"> <![endif]-->
<!--[if IE 9]><div id="childListWrap" class="lt-ie10 ie9 childListWrap"><![endif]-->
<!--[if gt IE 9]><!--><div id="childListWrap" class="childListWrap"> <!--<![endif]-->
<style>
.red{width:40px;height:20px;display:block;}
.redd{width:60px;height:20px;display:block;}
.redh{width:80px;height:20px;display:block;}
.kuai{width:40px;float:left;height:20px;display:block;text-align:center}
.kuai_thh{width:80px;float:left;height:20px;display:block;text-align:center}
.kuai_thd{width:60px;float:left;height:20px;display:block;text-align:center}
.kuai_d{width:60px;float:left;height:20px;display:block;text-align:center}
.kuai_t {width: 40px;height: 40px;display:inline-block;text-align:center}
.kuai_td {width: 60px;height: 40px;display:inline-block;text-align:center}
.kuai_th {width: 80px;height: 40px;display:inline-block;text-align:center}
.numPrice{cursor:pointer;}
#fullbg { z-index:1000;background-color:gray; opacity:0.5; position:absolute; top:0; z-index:9000; filter:alpha(opacity=50); -moz-opacity:0.5; -khtml-opacity:0.5; } 
#fullbg1 {z-index:1000;  opacity:0.5; position:absolute; top:0; z-index:3; filter:alpha(opacity=50); -moz-opacity:0.5; -khtml-opacity:0.5; } 
#dialog { background-color:#fff;border:5px solid rgba(0,0,0, 0.4);  height:270px; left:50%; margin:-200px 0 0 -200px; padding:1px; position:fixed !important; /* 浮动对话框 */ 
position:absolute; top:55%; width:400px; z-index:9999; border-radius:5px; display:none;  } 
#dialog p { margin:0 0 12px; line-height:30px;font-size:1.5em;height:30px; background:#CCCCCC; } 
#dialog p.close { text-align:left; padding-left:40px; height:40px;line-height:40px;} 
#dialog p.close a { color:#fff; text-decoration:none; }
#dialog .sure_btn{width:630px;text-align:center;margin-top:-20px;}
#dialog .alliance_edit{display:block;height:80px;text-align:left;padding-left:40px;}
#dialog .alliance_edit .alliance_d{padding-top:20px;}
#dialog .alliance_edit .alliance_g{padding-top:20px;padding-bottom:10px;}
#dialog .alliance_edit .alliance_h{padding-left: 60px;}
#dialog .alliance_edit .dname_x{padding-right:10px;}
#dialog .alliance_edit .dname_a{height: 20px;line-height: 20px;border: 1px solid #e5e5e5;
padding: 3px 5px;background: #fcfcfc;width: 240px;}
#dialog .alliance_edit .platform{height: 20px;line-height: 20px;border: 1px solid #e5e5e5;
padding: 3px 5px;background: #fcfcfc;width: 240px;}
#dialog .alliance_edit .platform_x{padding-right:10px;}
#dialog .alliance_edit .alliance_sure{width: 100px;height: 30px;margin-right: 10px;
line-height: 30px;border: 0;font-size: 1.4em;background-color: #00a0e9;text-align: center;font-weight: normal;
color: #FFF;margin-top: 10px;cursor: pointer;padding-right:10px;}
</style>
<ul  class="aatabHead">
		<li class="profit active">联盟管理</li>
	</ul></br>
	<input type="hidden" id="lid" value="<?=$_REQUEST['lid']?>" />
	<input type="hidden" name="sort" value='<?=json_encode($sort)?>'/>
	<a id="addChildBtn_a" class="addChildBtn" href="alliance_add.html" target="_blank">创建</a>
<table id="listTable" class="proTable fixed">
		<thead id="proTableHead">
			<tr>
				<th class="col_1">联盟名称</th>
				<th class="col_2">分配比例</th>
				<th class="col_3">创建时间</th>
				<th class="col_4">状态</th>
				<th class="col_5">操作</th>
			</tr>
		</thead>
		<tbody>
			<?foreach($alist as $data):?>
				<!-- <tr class="marTop"><td colspan="5" style="border:0px"></td></tr> -->
            <tr class="listBody borderBottom" data-id="<?=$data['id']?>">
                <td class="col_1 col" rowspan="1"><span class="test" ><?=$data['dtitle']?></span></td>
				<td class="col_2 col">
					<span class="numPrice" data-id="<?=$data['dratio']?>"><?=$data['dratio']?></span>
				</td>
				<td class="col_3 col" rowspan="1">
					<span><?=$data['createtime']?></span> 
				</td> 
				<td class="col_4 col" rowspan="1" data="<?=$data['dstatus']?>">
					<span class="yujbtn <?=($data['dstatus']) ? '':'onyuj'?>"  id="yuj" data-id="<?=$data['id']?>"></span>
				</td>
				<td class="col_5 col" rowspan="1">
					 <a class="do edit all_edit" data-id="<?=$data['id']?>" data-dname="<?=$data['dtitle']?>" data-pt="<?=$data['dratio']?>"><i class="cpicon edit"></i><i class="cpicon edit-hover hover"></i></a> 
					<!-- <a class="do close" href="###"><i class="cpicon close"></i><i class="cpicon close-hover hover"></i></a> -->
				</td>
			</tr>
			<?endforeach;?>
		<!-- <tr class="marbuttom"><td colspan="5" style="border:0px"></td></tr> -->
		</tbody>
	</table>
	<?page($count,$currentPage,$pageSize)?>
	<span id="alliance_m"></span>
	<div id="fullbg"></div> 
	<div id="dialog"> 
		<p class="close">联盟信息</p>
		<div class="alliance_edit">
			<div class="alliance_d">
				<span class="dname_x">联盟名称:</span><input class="dname_a" value="" name="dname_a">
			</div>
			<div class="alliance_g">
				<span class="platform_x">平台比例:</span><input class="platform" value="" name="platform">
			</div>
			<div class="alliance_h">
				<input type="button" id="sure" value="保存" class="alliance_sure"/>
				<a href="#" onclick="closeBg();">取消</a>
			</div>
		</div>
	</div>
<script type="text/javascript" src="http://www.12301.cc/js/global/www.12301.cc.global.js"></script>
<script type="text/javascript" src="http://www.12301.cc/js/marketing/marketing_list.js"></script>
<script type="text/javascript" src="http://www.12301.cc/js/alliance_manage.js"></script>
</div>
<?php include('common/footer.html')?>